var express = require('express');
var app = express.Router();

/* GET home page. */
app.get('/', function(req, res, next) {
	res.render('index', {
		title: '首页',
		activeMenu: 'index'
	});
});

app.get('/index.html', function(req, res, next) {
	res.render('index', {
		title: '首页',
		activeMenu: 'index'
	});
});

app.get('/article.html', function(req, res, next) {
	res.render('article', {
		title: '我的文章',
		activeMenu: 'article'
	});
});

app.get('/exam.html', function(req, res, next) {
	res.render('exam', {
		title: '我的课程',
		activeMenu: 'exam'
	});
});

app.get('/train.html', function(req, res, next) {
	res.render('train', {
		title: '我的培训',
		activeMenu: 'train',
		type: req.query.type || 0
	});
});

app.get('/test.html', function(req, res, next) {
	res.render('test', {
		title: '我的考试',
		activeMenu: 'test',
		type: req.query.type || 0
	});
});

app.get('/test/exam.html', function(req, res, next) {
	res.render('test/exam', {
		title: '我的考试'
	});
});

app.get('/exchange.html', function(req, res, next) {
	res.render('exchange', {
		title: '社区交流',
		activeMenu: 'exchange',
		type: req.query.type || 0
	});
});

app.get('/notice.html', function(req, res, next) {
	res.render('notice', {
		title: '公告',
		activeMenu: 'notice'
	});
});

app.get('/message.html', function(req, res, next) {
	res.render('message', {
		title: '消息',
		activeMenu: 'notice'
	});
});

app.get('/help.html', function(req, res, next) {
	res.render('help', {
		title: '帮助',
		activeMenu: 'help',
		type: req.query.type || 0
	});
});

app.get('/login.html', function(req, res, next) {
	res.render('login', {
		title: '登录'
	});
});

module.exports = app;